package com.fishbone.jwt;

import com.nimbusds.jwt.JWTClaimsSet;

import java.util.Map;

/**
 * @ClassName JwtTokenGenerator
 * @Author huyaxi
 * @DATE 2020/4/2 10:21
 */
public interface JwtTokenGenerator {

    /**
     * 生成token
     * @param aud 接收Jwt的一方
     * @param additional
     * @return
     */
    JwtTokenPair jwtTokenPair(String aud,Map<String, Object> additional);


    /**
     * 校验token
     * @param token
     * @return
     */
    JWTClaimsSet decodeAndVerify(String token);


    /**
     * 生成token key
     * @param account
     * @param userId
     * @param customerId
     * @return
     */
    String generateAud(String account,Long userId,String customerId);
}
